<?php
header("content-type: text/plain;charset=UTF-8");

$queue = glob(__DIR__ . '/../../queue/*');
echo "--- QUEUE ---" . PHP_EOL;
foreach ($queue as $item) {
    echo "Name: " . pathinfo($item, PATHINFO_BASENAME) . PHP_EOL;
    echo "  Content: " . file_get_contents($item) . PHP_EOL;
}

$dataDirs = glob(__DIR__ . '/../../data/*');
echo "--- DATA ---" . PHP_EOL;
foreach ($dataDirs as $dataDir) {
    echo "Name: " . pathinfo($dataDir, PATHINFO_BASENAME) . PHP_EOL;
    if (file_exists($dataDir . '/origin.mp4')) {
        echo "  > origin.mp4 Fetched" . PHP_EOL;
    }
    if (file_exists($dataDir . '/playlist.m3u8')) {
        echo "  > playlist.m3u8 Fetched" . PHP_EOL;
    }
}
